{% extends 'layout.html' %}

{% block content %}
    <div class="listBox">
        <h1>{{content.title}}</h1>
        <p class="colDefault">
            作者：<span class="colInfo">{{content.user.username}}</span>
            时间：<span class="colInfo">{{content.addTime | date('Y年m月d日 H:i:s',-8*60)}}</span>
            阅读：<span class="colInfo">{{content.views}}</span>
            评论：<span class="colInfo">{{content.comments.length}}</span>
        </p>
        <dfn>
            {{content.content}}
        </dfn>
    </div>
    <div class="listBox message">
        <h3 class="textLeft"><strong>评论</strong><span class="em">一共<em id="messageCount">0</em>条评论</span></h3>
        {% if userInfo._id %}
        <p class="textLeft">zmou</p>
        <p class="textLeft clear">
            <textarea id="messageContent"></textarea>
            <input type="hidden" id="contentId" value="{{content.id}}" />
            <button id="messageBtn" class="submit">提交</button>
        </p>
        {% else %}
        <p class="bgDanger" style="line-height: 30px;">你还没有登录，请先登录！</p>
        {% endif %}

        <div class="messageList">

        </div>

        <!-- 分页 -->
        <div class="pager">
            <ul class="clear">
                <li class="previous">
                    <a href="">上一页</a>
                </li>
                <li></li>
                <li class="next">
                    <a href="">下一页</a>
                </li>
            </ul>
        </div>

        <!-- <div class="messageList">
            <div class="messageBox"><p>还没有留言</p></div>
        </div> -->
        <!-- <div class="messageList">
            <div class="messageBox">
                <p class="name clear"><span class="f1">admin</span><span class="f1">2018-02-05</span></p>
                <p>fhakjhjk</p>
            </div>
        </div> -->
    </div>
<script src="/public/js/comment.js"></script>
{% endblock %}